home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / pcx.h < prev    next >
C/C++ Source or Header  |  1994-10-10  |  2KB  |  59 lines

  1. /*   PCX.H - tools for pcx file <--> screen swapping.
  2.          VGA, EGA 16 color modes are recomended.
  3.          Palette info could be (for perfomance) ignored, producing
  4.          incompatible files, of loaded from *.SYS file. In the last case
  5.          Borland standart palette is used. COLOR.SYS and BW.SYS are
  6.          the little PCX files, which are used as standart for palette
  7.          setting.
  8. */
  9.  
  10. #ifndef __PCX_H_
  11. #define __PCX_H_
  12.  
  13. #include <stdio.h>
  14. #include "graphpp.h"
  15. #include "pcxstrm.h"
  16. #include "image_p.h"
  17. #include "ic_part.h"
  18. #include "image.h"
  19. #include <io.h>
  20. #include <mem.h>
  21. #include <alloc.h>
  22.  
  23. struct pcxheader {
  24.      char       manuf;           /* Always = 10 for Paintbrush     */
  25.      char       hard;            /* Version info                   */
  26.      char       encod;           /* Coding ( = 1)                  */
  27.      char       bitpx;           /* bit per pixel                  */
  28.      int        x1;              /* Picture size (inclusive)       */
  29.      int        y1;
  30.      int        x2;
  31.      int        y2;
  32.      int        hres;            /* horiz. resolution of display   */
  33.      int        vres;            /* vert. resolution of display    */
  34.      char       clrma[48];       /* Palette                        */
  35.      char       vmode;           /* Ignored                        */
  36.      char       nplanes;         /* Num. of planes (rel. 2.5 = 0)  */
  37.      int        bplin;           /* Bytes per line                 */
  38.      int        palinfo;         /* Palette info (1=col.,2 = grey) */
  39.      int        shres;           /* Scanner resolution             */
  40.      int        svres;           /*                                */
  41.      char       xtra[54];        /* Filter                         */
  42.  };
  43.  
  44. void put_pcx_header(FILE* f, pcxheader* p, loc pos, int pal = 1,
  45.     int planes = N_PLANES);
  46.  
  47. int get_pcx_header(pcxstream* s, pcxheader* p_h);
  48. int get_pcx_header(FILE* file, pcxheader* p_h);
  49. int get_pcx_header(char* name, pcxheader* p_h);
  50.  
  51. // pal flag could be set to 0 for speed, but resulting files will be
  52. // compatible only with KNOW-HOW functions.
  53. // Always 1 bit / pixel and 4 planes 16-color images
  54. void pcx_scr_file(rect coord, char* name, int pal = 0);
  55.  
  56. int pcx_file_scr(char* name, loc pos, int* cells = NULL, int mode = COPY_PUT);
  57.  
  58.  
  59. #endif __PCX_H_